package DesignPatern.A18_备忘录模式.A03_高级模式;

import java.util.Stack;

/**
 * @Author: Du
 * @Date: 2021/8/6 15:01
 */
public class History
{
    Stack<BackUp> backUpStack = new Stack<>();
    
    public void add(BackUp backUp)
    {
        backUpStack.add(backUp);
    }
    
    public BackUp getLastVersion()
    {
        return backUpStack.pop();
    }
}
